// https://segmentfault.com/a/1190000041024600?sort=votes
const TerserPlugin = require("terser-webpack-plugin") 
module.exports = (ctx) =>{
    ctx.modifyWebpackChain(args=>{
        const chain = args.chain
        chain.merge({
            optimization: {
                minimize: true,
                minimizer: [
                  new TerserPlugin({
                    test:['taro.js','vendor.js','app.js'],
                    parallel:true,
                    cache:true,
                    extractComments:true,
                    parallel:true,
                    sourceMap:false,
                  }),
                ],
              },
        })
    }) 
  };